home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 13 - 1997 (partial) / 13.02 Feb 97 / Game Sprockets / Game Shell / Headers / App.h next >
Encoding:
C/C++ Source or Header  |  1996-12-04  |  3.8 KB  |  178 lines  |  [TEXT/CWIE]

  1. /***********************************************************************
  2. #
  3. #        App.h
  4. #
  5. #        This file contains the constants and structure definitions.
  6. #
  7. #        Author: Michael Marinkovich
  8. #
  9. #
  10. #        Modification History: 
  11. #
  12. #            6/4/95        MWM     Initial coding                     
  13. #            10/12/95    MWM        cleaned up
  14. #
  15. #        Copyright © 1992-95 Apple Computer, Inc., All Rights Reserved
  16. #
  17. #
  18. ***********************************************************************/
  19.  
  20. #include <QDOffscreen.h>
  21.  
  22.  
  23. //---------------------------------------------------------------------
  24. //
  25. //    Macros
  26. //
  27. //---------------------------------------------------------------------
  28.  
  29. #define MIN(x,y)            ( ((x)<(y)) ? (x) : (y) )
  30. #define MAX(x,y)            ( ((x)>(y)) ? (x) : (y) )
  31. #define TopLeft( r )        ( *(Point *) &(r).top )
  32. #define BotRight( r )        ( *(Point *) &(r).bottom )
  33.  
  34.  
  35. //---------------------------------------------------------------------
  36. //
  37. //    General
  38. //
  39. //---------------------------------------------------------------------
  40.  
  41. #define kMinHeap            300 * 1024
  42. #define kMinSpace            300 * 1024
  43.  
  44.  
  45. //---------------------------------------------------------------------
  46. //
  47. //    Menus
  48. //
  49. //---------------------------------------------------------------------
  50.  
  51. #define rMBarID                128
  52.  
  53. enum {
  54.      mApple                    = 128,
  55.     iAbout                    = 1,
  56.  
  57.     mFile                    = 129,
  58.     iNew                    = 1,
  59.     iOpen                    = 2,
  60.     iClose                    = 3,
  61.     iQuit                    = 5
  62. };
  63.  
  64.  
  65. //---------------------------------------------------------------------
  66. //
  67. //    Window stuff
  68. //
  69. //---------------------------------------------------------------------
  70.  
  71. // doc types
  72. enum {
  73.     kDocKind                = 94,
  74.     kDialogKind                = 95,
  75.     kFloatKind                = 96,
  76.     kAboutKind                = 97
  77. };    
  78.  
  79. #define kFudgeFactor        4        // fudge factor for boundary around window
  80. #define kTitleBarHeight        18        // title bar height
  81.  
  82. // scroll values
  83. #define kScrollWidth        15
  84. #define kScrollDelta        16
  85.  
  86.  
  87. //---------------------------------------------------------------------
  88. //
  89. //    General resource ID's
  90. //
  91. //---------------------------------------------------------------------
  92.  
  93. #define rAboutPictID        3000 // about picture
  94. #define rErrorDlg            128     // main error dialog
  95.  
  96.  
  97. //---------------------------------------------------------------------
  98. //
  99. //    Alert Error ID's
  100. //
  101. //---------------------------------------------------------------------
  102.  
  103. #define kNeedsDisplayManager        128    // ID of no Display Manager
  104.  
  105.  
  106. //---------------------------------------------------------------------
  107. //
  108. //    Custom Event Proc stuff
  109. //
  110. //---------------------------------------------------------------------
  111.  
  112. enum {
  113.     kIdleProc            = 1,
  114.     kMenuProc,
  115.     kInContentProc,
  116.     kInGoAwayProc,
  117.     kInZoomProc,
  118.     kInGrowProc,
  119.     kMUpProc,
  120.     kKeyProc,
  121.     kActivateProc,
  122.     kUpdateProc
  123. };
  124.     
  125.  
  126. //---------------------------------------------------------------------
  127. //
  128. //    Typedefs
  129. //
  130. //---------------------------------------------------------------------
  131.  
  132. // event handling proc
  133. typedef void (*CustomProc)(WindowRef window, void *refCon);
  134.  
  135.  
  136. // we just use the basic events for the callback procs
  137.  
  138. struct DocRec
  139. {    
  140.     CustomProc                    idleProc;            // custom idle proc
  141.     CustomProc                    mMenuProc;            // custom menu proc
  142.     CustomProc                    inContentProc;        // custom content click Proc
  143.     CustomProc                    inGoAwayProc;        // custom inGoAway proc
  144.     CustomProc                    inZoomProc;            // custom inZoom proc
  145.     CustomProc                    inGrowProc;            // custom inGrow proc
  146.     CustomProc                    mUpProc;            // custom mouseUp proc
  147.     CustomProc                    keyProc;            // custom autoKey-keyDown proc
  148.     CustomProc                    activateProc;        // custom activate window proc
  149.     CustomProc                    updateProc;            // custom window update proc
  150.     ControlRef                    hScroll;            // horz scroll bar
  151.     ControlRef                    vScroll;            // vert scroll bar
  152.     GWorldPtr                    world;                // offscreen for pict imaging
  153.     PicHandle                    pict;                // windows picture
  154.     THPrint                        printer;            // apps print record - inited at window int
  155.     Boolean                        dirty;                // document needs saving
  156. };
  157.  
  158. typedef struct DocRec DocRec;
  159. typedef DocRec *DocPtr, **DocHnd;
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.